package com.wdzj.main.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.UUID;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.wdzj.commons.DaoInterfaceimpl;
import com.wdzj.main.dao.iface.MainDao;

public class MainDaoImpl extends DaoInterfaceimpl implements MainDao{

	public void getinfosql() {

		try {
			this.getHibernateTemplate().execute(new HibernateCallback() {
				public Object doInHibernate(Session session)
						throws SQLException, HibernateException {
					for(int i=0;i<10000;i++){
						UUID uuid = UUID.randomUUID();
					Query query = session.createSQLQuery("insert into student(id,name) values(seq_xuesheng.nextval,'aaa')");
					query.executeUpdate();
					}
					return null;
				}
			});
		} catch (RuntimeException re) {
			
			throw re;
		}
	}
}